aa =  function(e, t, n) {
    "use strict";
    (function(e) {
        Object.defineProperty(t, "__esModule", {
            value: !0
        }), t.loginProcess = f, t.login = p, t.baiduLogin = d, t.authByEncryptedData = h, 
        t.loginEncryptedData = x, t.authByCode = m, t.checkTokenAtTheService = g, t.isAuthToken = _, 
        t.getTokenInfoByToken = T, t.isAuthTokenInfo = b;
        var a = u(n("a34a")), r = u(n("a4f7")), i = n("8d9d"), o = u(n("ca77")), s = n("d152");
        function u(e) {
            return e && e.__esModule ? e : {
                default: e
            };
        }
        function l(e, t, n, a, r, i, o) {
            try {
                var s = e[i](o), u = s.value;
            } catch (l) {
                return void n(l);
            }
            s.done ? t(u) : Promise.resolve(u).then(a, r);
        }
        function c(e) {
            return function() {
                var t = this, n = arguments;
                return new Promise(function(a, r) {
                    var i = e.apply(t, n);
                    function o(e) {
                        l(i, a, r, o, s, "next", e);
                    }
                    function s(e) {
                        l(i, a, r, o, s, "throw", e);
                    }
                    o(void 0);
                });
            };
        }
        function f() {
            return v.apply(this, arguments);
        }
        function v() {
            return v = c(a.default.mark(function e() {
                var t, n;
                return a.default.wrap(function(e) {
                    while (1) switch (e.prev = e.next) {
                      case 0:
                        t = 0;

                      case 1:
                        if (!(t < 3)) {
                            e.next = 19;
                            break;
                        }
                        return e.prev = 2, n = void 0, e.next = 6, p();

                      case 6:
                        return n = e.sent, e.next = 9, m(n);

                      case 9:
                        return e.abrupt("break", 19);

                      case 12:
                        if (e.prev = 12, e.t0 = e["catch"](2), t++, 3 !== t) {
                            e.next = 17;
                            break;
                        }
                        throw e.t0;

                      case 17:
                        e.next = 1;
                        break;

                      case 19:
                      case "end":
                        return e.stop();
                    }
                }, e, null, [ [ 2, 12 ] ]);
            })), v.apply(this, arguments);
        }
        function p() {
            return new Promise(function(t, n) {
                e.login({
                    success: function(e) {
                        e.code && t(e.code);
                    },
                    fail: function(e) {
                        n(e);
                    }
                });
            });
        }
        function d() {
            return new Promise(function(e, t) {
                swan.getLoginCode({
                    success: function(t) {
                        t.code && e(t.code);
                    },
                    fail: function(e) {
                        t(e);
                    }
                });
            });
        }
        function h(e) {
            return new Promise(function(t, n) {
                o.default.authByEncryptedData({
                    data: {
                        openId: r.default.state.basicInfo.openid,
                        rawData: e.rawData,
                        signature: e.signature,
                        encryptedData: e.encryptedData,
                        iv: e.iv
                    }
                }).then(function(e) {
                    r.default.commit(i.MUTATION_TYPES.SET_TOKEN, e.token), r.default.commit(i.MUTATION_TYPES.SET_AUTH_STATE, !0), 
                    t(e);
                }, function(e) {
                    n(e);
                });
            });
        }
        function x(e, t, n) {
            return y.apply(this, arguments);
        }
        function y() {
            return y = c(a.default.mark(function e(t, n, s) {
                return a.default.wrap(function(e) {
                    while (1) switch (e.prev = e.next) {
                      case 0:
                        return e.prev = 0, e.abrupt("return", o.default.loginBySecret({
                            data: {
                                encryptedData: t,
                                iv: n,
                                isAgainBind: s
                            }
                        }).then(function(e) {
                            return r.default.commit(i.MUTATION_TYPES.SET_TOKEN, e.token), r.default.commit(i.MUTATION_TYPES.SET_BIND_MOBILE_STATE, !0), 
                            e;
                        }));

                      case 4:
                        e.prev = 4, e.t0 = e["catch"](0);

                      case 6:
                      case "end":
                        return e.stop();
                    }
                }, e, null, [ [ 0, 4 ] ]);
            })), y.apply(this, arguments);
        }
        function m(t) {
            return new Promise(function(n, a) {
                o.default.authByCode({
                    data: {
                        code: t
                    }
                }).then(function(t) {
                    r.default.commit(i.MUTATION_TYPES.SET_OPENID, t.openId), e.setStorageSync("xoid", t.openId), 
                    t.requireEncryptedData ? (r.default.commit(i.MUTATION_TYPES.SET_AUTH_STATE, !1), 
                    r.default.commit(i.MUTATION_TYPES.SET_TOKEN, t.token)) : (r.default.commit(i.MUTATION_TYPES.SET_AUTH_STATE, !0), 
                    r.default.commit(i.MUTATION_TYPES.SET_TOKEN, t.token)), void 0 !== t.isNeedLogin && null !== t.isNeedLogin && r.default.commit(i.MUTATION_TYPES.SET_NEW_MEMBER_STATE, t.isNeedLogin), 
                    n(t);
                }, function(e) {
                    a(e);
                });
            });
        }
        function g() {
            return new Promise(function(e, t) {
                o.default.checkToken().then(function(t) {
                    e(t);
                }, function(e) {
                    t(e);
                });
            });
        }
        function _(e, t) {
            var n = T(e), a = b(n, t);
            return a;
        }
        function T(e) {
            try {
                if (!e) return {};
                var t = e.match(/\..+\./);
                if (!t || t.length <= 0) return {};
                t = t[0].replace(/\./g, "");
                var n = s.Base64.decode(t), a = JSON.parse(n);
                return a;
            } catch (r) {
                return {};
            }
        }
        function b(e) {
            var t = !(arguments.length > 1 && void 0 !== arguments[1]) || arguments[1];
            if (!e) return !1;
            if (!e.exp) return !1;
            var n = new Date().getTime(), a = e.exp >= 1e12 ? e.exp : 1e3 * e.exp;
            return !(n >= a) && !(t && !e.userId);
        }
    }).call(this, n("543d")["default"]);
}